// Quantitative Angiogram Analysis System
//
// Copyright ?Ping Zou, 2007
// sg71.cherub@gmail.com

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace eee.Sheffield.PZ.QAAS
{
    /// <summary>
    /// base FilterControl class
    /// provide general fields, properties and methods for filter controls. 
    /// </summary>
    public partial class FilterControl : UserControl, IFilterControl
    {
        #region Fields
        //protected Bitmap _image;
        protected MainForm _mainForm;
        protected ImageDoc _imageDoc;
        protected string _log;
        protected string _flag;
        #endregion

        #region Properties
        public string LogText { get { return _log; } set { _log = value; } }
        public string Flag { get { return _flag; } }
        public MainForm MainForm { set { _mainForm = value; } }
        public ImageDoc ImageDoc { get { return _imageDoc; } set { _imageDoc = value; } }
        //public Bitmap Image { get { return _image; } set { _image = value; } }
        #endregion

        #region Constructor
        public FilterControl() { InitializeComponent(); }
        //public FilterControl(Bitmap image)
        //{
        //    _image = image;
        //    InitializeComponent();
        //}
        public FilterControl(MainForm mainForm, ImageDoc imageDoc)
        {
            _mainForm = mainForm;
            _imageDoc = imageDoc;
            InitializeComponent();
        }
        #endregion

        #region interface method
        public virtual void Reload()
        {
        }
        #endregion


        #region Main Form methods
        /// <summary>
        /// show image
        /// </summary>
        /// <param name="image"></param>
        /// <param name="caption"></param>
        protected void ShowImage(Bitmap image, string caption)
        {
            _mainForm.ShowImage(image, caption);
        }

        /// <summary>
        /// log
        /// </summary>
        /// <param name="log"></param>
        protected void Log(string log)
        {
            _mainForm.Log(log);
        }
        #endregion
    }
}
